package com.jjkj.environmental.environmental.utils

import com.jjkj.environmental.environmental.bean.model.UserSetting
import org.litepal.LitePal
import org.litepal.extension.findLast

object LitePalHelper {
    fun getUserSetting(): UserSetting {
        return try {
            LitePal.findLast<UserSetting>()
        } catch (e: Exception) {
            UserSetting("192.168.0.1", "00000000")
        }
    }

    fun getUrl(): String = Setting.appendUrl(getUserSetting().ipAddress)
}